package com.lejin.usercenter.controller;


import com.lejin.interceptor.UserInfoInterceptor;
import com.lejin.usercenter.entity.UserSchool;
import com.lejin.usercenter.service.IUserSchoolService;
import com.lejin.vo.ResultVO;
import org.bouncycastle.cms.PasswordRecipientId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 学校 前端控制器
 * </p>
 *
 * @author luminghua
 * @since 2022-04-21
 */
@CrossOrigin
@RestController
@RequestMapping("/usercenter/user-school")
public class UserSchoolController {
    @Autowired
    private UserInfoInterceptor userInfoInterceptor;
    @Autowired
    private IUserSchoolService iUserSchoolService;

    @RequestMapping("list")
    public ResultVO list(){

        ResultVO userSchoolByUid1 = iUserSchoolService.findUserSchoolByUid(userInfoInterceptor.getThreadLocal().get());
        return userSchoolByUid1;

    }


    @RequestMapping("add")
    public ResultVO add(@RequestBody UserSchool userSchool){

        ResultVO resultVO = iUserSchoolService.addUserSchool(userSchool);
        return resultVO;
    }


}
